<template>
  <div class="home">
    <el-container>
      <el-aside width="200px">
        <Aside :isCollapse="isCollapse" />
      </el-aside>
      <el-container>
        <el-header>
          <!-- 将Home组件中的值和方法 传到 Header组件中 -->
          <Header :handleCollapse="handleCollapse" :isCollapse="isCollapse" />
        </el-header>
        <el-main>
          <Main />
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup>
import router from '../router/index';
import Header from '../components/Header.vue';
import Main from '../components/Main.vue';
import Aside from '../components/Aside.vue';

import { ref, onMounted } from 'vue';
import request from '../utils/request';



const isCollapse = ref(false); //默认(展开)不折叠 Collapse:折叠

const handleCollapse = () => {
  isCollapse.value = !isCollapse.value;
};

const toGo = (val) => {
  router.push(val);
};
</script>
<style lang="less" scoped>
.el-aside {
  width: auto;
  background-color: #545c64;
  width: auto;
  overflow: hidden;
}

.el-container {
  height: 100vh;
}

.el-main {
  display: flex;
}

.el-header {
  // padding: 0 20px 0 0;
  background-color: #fff;
}
</style>
